<?php

namespace App\Controller\Setting;

use App\Controller\BaseController;
use App\Model\PointLog;
use App\Utils\FunUtil;

class BuildPointController extends BaseController
{

    /**
     * Note - 埋点事件记录
     * DateTime 2024/9/5 19:24
     * User Admin
     */
    public function index()
    {
        // $data = $this->request->inputs(['imei', 'uid', 'point', 'user_id']);
        $data['imei'] = $this->request->post('imei', '');
        $data['uid'] = $this->request->post('uid', 0);
        $data['point'] = $this->request->post('point', '');
        $data['user_id'] = $this->request->post('user_id', 0);
        $data['ctime'] = time();
        $data['ip'] = FunUtil::getClientIp();
        PointLog::query()->insert($data);
        return $this->return();
    }
}